Skip to content

persist typescript vs python preference#2759

Open
nichochar wants to merge 3 commits into
mainfrom
ncharriere/06-12-persist_typescript_vs_python_preference
Open

persist typescript vs python preference#2759
nichochar wants to merge 3 commits into
mainfrom
ncharriere/06-12-persist_typescript_vs_python_preference

Conversation

@nichochar

@nichochar nichochar commented Jun 12, 2026

Copy link
Copy Markdown

Description

I was very frustrated as a TypeScript user navigating the docs because the website kept forgetting my preference of showing me typescript examples over python ones.

This writes a little script that injects the preference into localStorage and honors it in the future if using the same browser.

More changes than you'd think because we needed to normalize Typescript -> TypeScript casing + added instructions for future agents making changes to honor this conventin

Copy link
Copy Markdown
Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

nichochar and others added 2 commits June 12, 2026 10:45
Document that <CodeGroup>/<Tab> language labels must use canonical, consistent casing (Python/TypeScript/Bash) so the cross-page language preference matches, and that code-group-language-persist.js handles persistence globally. Also fix a stray "Typescript" in the lexer guidance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
wandb 🟢 Ready View Preview Jun 12, 2026, 5:53 PM

@nichochar nichochar force-pushed the ncharriere/06-12-persist_typescript_vs_python_preference branch from a69bf17 to 1669e96 Compare June 12, 2026 17:52
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

📚 Mintlify Preview Links

🔗 View Full Preview

📝 Changed (9 total)

📄 Pages (8)

File Preview
fr/weave/guides/tracking/view-call.mdx View Call
ja/weave/guides/tracking/view-call.mdx View Call
ko/weave/guides/tracking/view-call.mdx View Call
weave/concepts/what-is-weave.mdx What Is Weave
weave/guides/platform/weave-projects.mdx Weave Projects
weave/guides/tracking/get-call-object.mdx Get Call Object
weave/guides/tracking/tracing.mdx Tracing
weave/guides/tracking/view-call.mdx View Call
⚙️ Other (1)
File
AGENTS.md

🤖 Generated automatically when Mintlify deployment succeeds
📍 Deployment: 5cce923 at 2026-06-12 23:41:00 UTC

@nichochar nichochar marked this pull request as ready for review June 12, 2026 17:54
@nichochar nichochar requested a review from a team as a code owner June 12, 2026 17:54
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🔗 Link Checker Results

All links are valid!

No broken links were detected.

Checked against: https://wb-21fd5541-ncharriere-06-12-persist-typescript-vs-python-p.mintlify.app

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1669e962ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread code-group-language-persist.js Outdated
Comment on lines +51 to +52
python: 1, py: 1, typescript: 1, ts: 1, javascript: 1, js: 1, jsx: 1,
tsx: 1, node: 1, 'node.js': 1, nodejs: 1, bash: 1, shell: 1, sh: 1,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep Bash tabs from overwriting SDK preference

Because this global preference stores every whitelisted tab label, clicking an existing Bash tab, such as the Python/Bash examples under inference/response-settings/*.mdx, overwrites a user's saved TypeScript preference with Bash. Subsequent Weave pages whose SDK tabs are only Python/TypeScript have no Bash match, so they fall back to the first tab until the reader reselects TypeScript, which defeats the TypeScript-vs-Python persistence this script is meant to provide. Consider limiting persisted labels to SDK-language choices that should apply across pages, or scoping non-SDK choices per tab group.

Useful? React with 👍 / 👎.

Narrow the cross-page language whitelist in code-group-language-persist.js to Python and TypeScript. Previously any whitelisted label (Bash, shell, cURL, YAML, etc.) was persisted, so clicking e.g. a Bash tab overwrote the saved Python/TypeScript choice; a later page whose tabs are only Python/TypeScript then had no match and fell back to its first tab, defeating the persistence. Restore is case-insensitive, so the canonical labels cover python/Python/TypeScript alike. AGENTS.md updated to match. Addresses the Codex review on the PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant